import { Hook } from '../cors/hook';
type THookNames = Exclude<keyof Hook, 'createCustomHook'|'removeCustomHook'>
export function AddHook(name: THookNames) {
    return (target: any, key: string, decorators: any): any => {
        if (target.constructor.prototype.__ADD_HOOK__ === undefined) {
            Object.defineProperty(target, '__ADD_HOOK__', {
                enumerable: false,
                value: []
            })
        }
        target.constructor.prototype.__ADD_HOOK__.push({
            hookName: name,
            hookFuncName: key 
        })
    };
}